//
//  QuGrid.m
//  Utils
//
//  Created by enghou on 2018/4/24.
//  Copyright © 2018年 xyxorigation. All rights reserved.
//

#import "QuGrid.h"
#import "FrameGrid.h"
@implementation QuGrid
-(instancetype)initWithSource:(NSDictionary *)source{
    self = [super initWithSource:source];
    if (self) {
        self.ids = [self contentForKey:@"id" withSource:source];
        self.name = [self contentForKey:@"name" withSource:source];
        self.isGrid = [[source objectForKey:@"isGrid"] boolValue];
        NSArray *frames = [source objectForKey:@"orgFrames"];
        NSMutableArray *fs = [NSMutableArray array];
        for (NSDictionary *element in frames) {
            FrameGrid *frame = [[FrameGrid alloc]initWithSource:element];
            [fs addObject:frame];
        }
        self.subOrgs = fs;
    }
    return self;
}
@end
